﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SInvaders
{
    public class Creditos
    {
        Texture2D telaCreditos;
        Texture2D botao;
        Aviso aviso = new Aviso();

        public void LoadContent(ContentManager content)
        {
            telaCreditos = content.Load<Texture2D>("telacreditos");
            botao = content.Load<Texture2D>("botaomenu");
            aviso.LoadContent(content);
        }

        public void Update(KeyboardState tecladoAtual, KeyboardState tecladoAnterior)
        {
            aviso.Update();

            if (tecladoAtual.IsKeyDown(Keys.Enter) && !tecladoAnterior.IsKeyDown(Keys.Enter))
            {
                GerenciadorFases.EstadoAtual = GerenciadorFases.EstadosJogo.MENU;
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(telaCreditos, new Vector2(0, 0), Color.White);
            spriteBatch.Draw(botao, new Vector2(610, 330), Color.White);
            aviso.Draw(spriteBatch);

        }
    }
}
